package day07demo;

import java.util.Random;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        int[] arr = new int[6];
        int score ;
        int randomScore;
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入得分");
            //randomScore = r.nextInt(100)+1;
            score = sc.nextInt();
            arr[i] = score;
            System.out.print(arr[i] + " ");
        }
        int max = arr[0];
        int min = arr[0];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            max = arr[i] > max ? max = arr[i] : max;
            min = arr[i] < min ? min = arr[i] : min;
            sum = sum + arr[i];
        }
        int avg = (sum - max - min) / arr.length-2;
        System.out.println();
        System.out.println("最大值为" + max);
        System.out.println("最小值为" + min);
        System.out.println(avg);
    }
}
